fs/sfs: Check if allocated memory is NULL
authorAlec Brown <alec.r.brown@oracle.com>
Tue, 28 Jan 2025 05:15:50 +0000 (05:15 +0000)
committerFelix Zielcke <fzielcke@z-51.de>
Thu, 3 Jul 2025 16:35:51 +0000 (18:35 +0200)
commite945ea01cb4a754005acda3bdadb956e02431c78
tree0415e66a8ff58299797863d8879f8328d4a9b8db
parent943ca417f9a500879adceabb6db09ff10852f3b8
fs/sfs: Check if allocated memory is NULL

When using grub_zalloc(), if we are out of memory, this function can fail.
After allocating memory, we should check if grub_zalloc() returns NULL.
If so, we should handle this error.

Fixes: CID 473856
Signed-off-by: Alec Brown <alec.r.brown@oracle.com>
Reviewed-by: Ross Philipson <ross.philipson@oracle.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Gbp-Pq: Topic cve-2025-jan
Gbp-Pq: Name fs-sfs-Check-if-allocated-memory-is-NULL.patch
grub-core/fs/sfs.c